package random;

import java.util.List;
import java.util.Random;

public class TestMTRNG {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		long seed = 4357;
		int n = 100000000;
		MersenneTwister mt1 = new MersenneTwister(seed);
		long e0 = System.currentTimeMillis();
		for(int i = 0; i < n; i++){
			mt1.nextInt();
		}
		long e1 = System.currentTimeMillis();
		System.out.println("MersenneTwister: "+(e1-e0)+"ms "+mt1.nextInt());
		MersenneTwisterFast mt2 = new MersenneTwisterFast(seed);
		long e2 = System.currentTimeMillis();
		for(int i = 0; i < n; i++){
			mt2.nextInt();
		}
		long e3 = System.currentTimeMillis();
		System.out.println("MersenneTwisterFast: "+(e3-e2)+"ms "+mt2.nextInt());
		MTRandom mt3 = new MTRandom(seed);
		long e4 = System.currentTimeMillis();
		for(int i = 0; i < n; i++){
			mt3.nextInt();
		}
		long e5 = System.currentTimeMillis();
		System.out.println("MTRandom: "+(e5-e4)+"ms "+mt3.nextInt());
		Random r = new Random(seed);
		long e6 = System.currentTimeMillis();
		for(int i = 0; i < n; i++){
			r.nextInt();
		}
		long e7 = System.currentTimeMillis();
		System.out.println("Random: "+(e7-e6)+"ms "+r.nextInt());
	}

}
